home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / rbsetnv1.zip / GETSWITC.C < prev    next >
Text File  |  1990-04-10  |  438b  |  26 lines

  1. #include <stdio.h>
  2. #include <dos.h>
  3.  
  4. static    char    SW = 0;        /* DOS switch character, either '-' or '/' */
  5.  
  6. int getswitch()
  7. {
  8.    if (SW == 0) {
  9.       /* get SW using dos call 0x3700 */
  10.       _AX = 0x3700;
  11.       geninterrupt(0x21);
  12.       SW = _DL;
  13.    }
  14.    return( SW & 0xFF );
  15. }
  16.  
  17. int setswitch(char c)
  18. {
  19.     /* set SW using dos call 0x3701 */
  20.     _AX = 0x3701;
  21.     _DL = c;
  22.     geninterrupt(0x21);
  23.     SW = c;
  24.     return( SW & 0xFF );
  25. }
  26.